{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world\n"
     ]
    }
   ],
   "source": [
    "print('hello world')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "1\n",
      "2\n",
      "3\n",
      "4\n",
      "5\n",
      "6\n",
      "7\n",
      "8\n",
      "9\n"
     ]
    }
   ],
   "source": [
    "for i in range(10): print(i)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Magic Method "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "G'day!\n"
     ]
    }
   ],
   "source": [
    "%run say_hello.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "G'day!\n"
     ]
    }
   ],
   "source": [
    "# %load say_hello.py\n",
    "#!python3 \n",
    "print(\"G'day!\")\n",
    "def say_i(i):\n",
    "\tfor j in range(i): print(j)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "1\n",
      "2\n",
      "3\n",
      "4\n"
     ]
    }
   ],
   "source": [
    "say_i(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "241 µs ± 884 ns per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit [i**2 for i in range(1000)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "275 ms ± 8.02 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "%timeit [i**2 for i in range(1000000)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2.44 µs ± 8.4 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit [i**2 for i in range(10)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "305 µs ± 2.4 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%%timeit \n",
    "li = []\n",
    "for i in range(1000):\n",
    "    li.append(i ** 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 1.14 ms, sys: 21 µs, total: 1.16 ms\n",
      "Wall time: 1.18 ms\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[0,\n",
       " 1,\n",
       " 4,\n",
       " 9,\n",
       " 16,\n",
       " 25,\n",
       " 36,\n",
       " 49,\n",
       " 64,\n",
       " 81,\n",
       " 100,\n",
       " 121,\n",
       " 144,\n",
       " 169,\n",
       " 196,\n",
       " 225,\n",
       " 256,\n",
       " 289,\n",
       " 324,\n",
       " 361,\n",
       " 400,\n",
       " 441,\n",
       " 484,\n",
       " 529,\n",
       " 576,\n",
       " 625,\n",
       " 676,\n",
       " 729,\n",
       " 784,\n",
       " 841,\n",
       " 900,\n",
       " 961,\n",
       " 1024,\n",
       " 1089,\n",
       " 1156,\n",
       " 1225,\n",
       " 1296,\n",
       " 1369,\n",
       " 1444,\n",
       " 1521,\n",
       " 1600,\n",
       " 1681,\n",
       " 1764,\n",
       " 1849,\n",
       " 1936,\n",
       " 2025,\n",
       " 2116,\n",
       " 2209,\n",
       " 2304,\n",
       " 2401,\n",
       " 2500,\n",
       " 2601,\n",
       " 2704,\n",
       " 2809,\n",
       " 2916,\n",
       " 3025,\n",
       " 3136,\n",
       " 3249,\n",
       " 3364,\n",
       " 3481,\n",
       " 3600,\n",
       " 3721,\n",
       " 3844,\n",
       " 3969,\n",
       " 4096,\n",
       " 4225,\n",
       " 4356,\n",
       " 4489,\n",
       " 4624,\n",
       " 4761,\n",
       " 4900,\n",
       " 5041,\n",
       " 5184,\n",
       " 5329,\n",
       " 5476,\n",
       " 5625,\n",
       " 5776,\n",
       " 5929,\n",
       " 6084,\n",
       " 6241,\n",
       " 6400,\n",
       " 6561,\n",
       " 6724,\n",
       " 6889,\n",
       " 7056,\n",
       " 7225,\n",
       " 7396,\n",
       " 7569,\n",
       " 7744,\n",
       " 7921,\n",
       " 8100,\n",
       " 8281,\n",
       " 8464,\n",
       " 8649,\n",
       " 8836,\n",
       " 9025,\n",
       " 9216,\n",
       " 9409,\n",
       " 9604,\n",
       " 9801,\n",
       " 10000,\n",
       " 10201,\n",
       " 10404,\n",
       " 10609,\n",
       " 10816,\n",
       " 11025,\n",
       " 11236,\n",
       " 11449,\n",
       " 11664,\n",
       " 11881,\n",
       " 12100,\n",
       " 12321,\n",
       " 12544,\n",
       " 12769,\n",
       " 12996,\n",
       " 13225,\n",
       " 13456,\n",
       " 13689,\n",
       " 13924,\n",
       " 14161,\n",
       " 14400,\n",
       " 14641,\n",
       " 14884,\n",
       " 15129,\n",
       " 15376,\n",
       " 15625,\n",
       " 15876,\n",
       " 16129,\n",
       " 16384,\n",
       " 16641,\n",
       " 16900,\n",
       " 17161,\n",
       " 17424,\n",
       " 17689,\n",
       " 17956,\n",
       " 18225,\n",
       " 18496,\n",
       " 18769,\n",
       " 19044,\n",
       " 19321,\n",
       " 19600,\n",
       " 19881,\n",
       " 20164,\n",
       " 20449,\n",
       " 20736,\n",
       " 21025,\n",
       " 21316,\n",
       " 21609,\n",
       " 21904,\n",
       " 22201,\n",
       " 22500,\n",
       " 22801,\n",
       " 23104,\n",
       " 23409,\n",
       " 23716,\n",
       " 24025,\n",
       " 24336,\n",
       " 24649,\n",
       " 24964,\n",
       " 25281,\n",
       " 25600,\n",
       " 25921,\n",
       " 26244,\n",
       " 26569,\n",
       " 26896,\n",
       " 27225,\n",
       " 27556,\n",
       " 27889,\n",
       " 28224,\n",
       " 28561,\n",
       " 28900,\n",
       " 29241,\n",
       " 29584,\n",
       " 29929,\n",
       " 30276,\n",
       " 30625,\n",
       " 30976,\n",
       " 31329,\n",
       " 31684,\n",
       " 32041,\n",
       " 32400,\n",
       " 32761,\n",
       " 33124,\n",
       " 33489,\n",
       " 33856,\n",
       " 34225,\n",
       " 34596,\n",
       " 34969,\n",
       " 35344,\n",
       " 35721,\n",
       " 36100,\n",
       " 36481,\n",
       " 36864,\n",
       " 37249,\n",
       " 37636,\n",
       " 38025,\n",
       " 38416,\n",
       " 38809,\n",
       " 39204,\n",
       " 39601,\n",
       " 40000,\n",
       " 40401,\n",
       " 40804,\n",
       " 41209,\n",
       " 41616,\n",
       " 42025,\n",
       " 42436,\n",
       " 42849,\n",
       " 43264,\n",
       " 43681,\n",
       " 44100,\n",
       " 44521,\n",
       " 44944,\n",
       " 45369,\n",
       " 45796,\n",
       " 46225,\n",
       " 46656,\n",
       " 47089,\n",
       " 47524,\n",
       " 47961,\n",
       " 48400,\n",
       " 48841,\n",
       " 49284,\n",
       " 49729,\n",
       " 50176,\n",
       " 50625,\n",
       " 51076,\n",
       " 51529,\n",
       " 51984,\n",
       " 52441,\n",
       " 52900,\n",
       " 53361,\n",
       " 53824,\n",
       " 54289,\n",
       " 54756,\n",
       " 55225,\n",
       " 55696,\n",
       " 56169,\n",
       " 56644,\n",
       " 57121,\n",
       " 57600,\n",
       " 58081,\n",
       " 58564,\n",
       " 59049,\n",
       " 59536,\n",
       " 60025,\n",
       " 60516,\n",
       " 61009,\n",
       " 61504,\n",
       " 62001,\n",
       " 62500,\n",
       " 63001,\n",
       " 63504,\n",
       " 64009,\n",
       " 64516,\n",
       " 65025,\n",
       " 65536,\n",
       " 66049,\n",
       " 66564,\n",
       " 67081,\n",
       " 67600,\n",
       " 68121,\n",
       " 68644,\n",
       " 69169,\n",
       " 69696,\n",
       " 70225,\n",
       " 70756,\n",
       " 71289,\n",
       " 71824,\n",
       " 72361,\n",
       " 72900,\n",
       " 73441,\n",
       " 73984,\n",
       " 74529,\n",
       " 75076,\n",
       " 75625,\n",
       " 76176,\n",
       " 76729,\n",
       " 77284,\n",
       " 77841,\n",
       " 78400,\n",
       " 78961,\n",
       " 79524,\n",
       " 80089,\n",
       " 80656,\n",
       " 81225,\n",
       " 81796,\n",
       " 82369,\n",
       " 82944,\n",
       " 83521,\n",
       " 84100,\n",
       " 84681,\n",
       " 85264,\n",
       " 85849,\n",
       " 86436,\n",
       " 87025,\n",
       " 87616,\n",
       " 88209,\n",
       " 88804,\n",
       " 89401,\n",
       " 90000,\n",
       " 90601,\n",
       " 91204,\n",
       " 91809,\n",
       " 92416,\n",
       " 93025,\n",
       " 93636,\n",
       " 94249,\n",
       " 94864,\n",
       " 95481,\n",
       " 96100,\n",
       " 96721,\n",
       " 97344,\n",
       " 97969,\n",
       " 98596,\n",
       " 99225,\n",
       " 99856,\n",
       " 100489,\n",
       " 101124,\n",
       " 101761,\n",
       " 102400,\n",
       " 103041,\n",
       " 103684,\n",
       " 104329,\n",
       " 104976,\n",
       " 105625,\n",
       " 106276,\n",
       " 106929,\n",
       " 107584,\n",
       " 108241,\n",
       " 108900,\n",
       " 109561,\n",
       " 110224,\n",
       " 110889,\n",
       " 111556,\n",
       " 112225,\n",
       " 112896,\n",
       " 113569,\n",
       " 114244,\n",
       " 114921,\n",
       " 115600,\n",
       " 116281,\n",
       " 116964,\n",
       " 117649,\n",
       " 118336,\n",
       " 119025,\n",
       " 119716,\n",
       " 120409,\n",
       " 121104,\n",
       " 121801,\n",
       " 122500,\n",
       " 123201,\n",
       " 123904,\n",
       " 124609,\n",
       " 125316,\n",
       " 126025,\n",
       " 126736,\n",
       " 127449,\n",
       " 128164,\n",
       " 128881,\n",
       " 129600,\n",
       " 130321,\n",
       " 131044,\n",
       " 131769,\n",
       " 132496,\n",
       " 133225,\n",
       " 133956,\n",
       " 134689,\n",
       " 135424,\n",
       " 136161,\n",
       " 136900,\n",
       " 137641,\n",
       " 138384,\n",
       " 139129,\n",
       " 139876,\n",
       " 140625,\n",
       " 141376,\n",
       " 142129,\n",
       " 142884,\n",
       " 143641,\n",
       " 144400,\n",
       " 145161,\n",
       " 145924,\n",
       " 146689,\n",
       " 147456,\n",
       " 148225,\n",
       " 148996,\n",
       " 149769,\n",
       " 150544,\n",
       " 151321,\n",
       " 152100,\n",
       " 152881,\n",
       " 153664,\n",
       " 154449,\n",
       " 155236,\n",
       " 156025,\n",
       " 156816,\n",
       " 157609,\n",
       " 158404,\n",
       " 159201,\n",
       " 160000,\n",
       " 160801,\n",
       " 161604,\n",
       " 162409,\n",
       " 163216,\n",
       " 164025,\n",
       " 164836,\n",
       " 165649,\n",
       " 166464,\n",
       " 167281,\n",
       " 168100,\n",
       " 168921,\n",
       " 169744,\n",
       " 170569,\n",
       " 171396,\n",
       " 172225,\n",
       " 173056,\n",
       " 173889,\n",
       " 174724,\n",
       " 175561,\n",
       " 176400,\n",
       " 177241,\n",
       " 178084,\n",
       " 178929,\n",
       " 179776,\n",
       " 180625,\n",
       " 181476,\n",
       " 182329,\n",
       " 183184,\n",
       " 184041,\n",
       " 184900,\n",
       " 185761,\n",
       " 186624,\n",
       " 187489,\n",
       " 188356,\n",
       " 189225,\n",
       " 190096,\n",
       " 190969,\n",
       " 191844,\n",
       " 192721,\n",
       " 193600,\n",
       " 194481,\n",
       " 195364,\n",
       " 196249,\n",
       " 197136,\n",
       " 198025,\n",
       " 198916,\n",
       " 199809,\n",
       " 200704,\n",
       " 201601,\n",
       " 202500,\n",
       " 203401,\n",
       " 204304,\n",
       " 205209,\n",
       " 206116,\n",
       " 207025,\n",
       " 207936,\n",
       " 208849,\n",
       " 209764,\n",
       " 210681,\n",
       " 211600,\n",
       " 212521,\n",
       " 213444,\n",
       " 214369,\n",
       " 215296,\n",
       " 216225,\n",
       " 217156,\n",
       " 218089,\n",
       " 219024,\n",
       " 219961,\n",
       " 220900,\n",
       " 221841,\n",
       " 222784,\n",
       " 223729,\n",
       " 224676,\n",
       " 225625,\n",
       " 226576,\n",
       " 227529,\n",
       " 228484,\n",
       " 229441,\n",
       " 230400,\n",
       " 231361,\n",
       " 232324,\n",
       " 233289,\n",
       " 234256,\n",
       " 235225,\n",
       " 236196,\n",
       " 237169,\n",
       " 238144,\n",
       " 239121,\n",
       " 240100,\n",
       " 241081,\n",
       " 242064,\n",
       " 243049,\n",
       " 244036,\n",
       " 245025,\n",
       " 246016,\n",
       " 247009,\n",
       " 248004,\n",
       " 249001,\n",
       " 250000,\n",
       " 251001,\n",
       " 252004,\n",
       " 253009,\n",
       " 254016,\n",
       " 255025,\n",
       " 256036,\n",
       " 257049,\n",
       " 258064,\n",
       " 259081,\n",
       " 260100,\n",
       " 261121,\n",
       " 262144,\n",
       " 263169,\n",
       " 264196,\n",
       " 265225,\n",
       " 266256,\n",
       " 267289,\n",
       " 268324,\n",
       " 269361,\n",
       " 270400,\n",
       " 271441,\n",
       " 272484,\n",
       " 273529,\n",
       " 274576,\n",
       " 275625,\n",
       " 276676,\n",
       " 277729,\n",
       " 278784,\n",
       " 279841,\n",
       " 280900,\n",
       " 281961,\n",
       " 283024,\n",
       " 284089,\n",
       " 285156,\n",
       " 286225,\n",
       " 287296,\n",
       " 288369,\n",
       " 289444,\n",
       " 290521,\n",
       " 291600,\n",
       " 292681,\n",
       " 293764,\n",
       " 294849,\n",
       " 295936,\n",
       " 297025,\n",
       " 298116,\n",
       " 299209,\n",
       " 300304,\n",
       " 301401,\n",
       " 302500,\n",
       " 303601,\n",
       " 304704,\n",
       " 305809,\n",
       " 306916,\n",
       " 308025,\n",
       " 309136,\n",
       " 310249,\n",
       " 311364,\n",
       " 312481,\n",
       " 313600,\n",
       " 314721,\n",
       " 315844,\n",
       " 316969,\n",
       " 318096,\n",
       " 319225,\n",
       " 320356,\n",
       " 321489,\n",
       " 322624,\n",
       " 323761,\n",
       " 324900,\n",
       " 326041,\n",
       " 327184,\n",
       " 328329,\n",
       " 329476,\n",
       " 330625,\n",
       " 331776,\n",
       " 332929,\n",
       " 334084,\n",
       " 335241,\n",
       " 336400,\n",
       " 337561,\n",
       " 338724,\n",
       " 339889,\n",
       " 341056,\n",
       " 342225,\n",
       " 343396,\n",
       " 344569,\n",
       " 345744,\n",
       " 346921,\n",
       " 348100,\n",
       " 349281,\n",
       " 350464,\n",
       " 351649,\n",
       " 352836,\n",
       " 354025,\n",
       " 355216,\n",
       " 356409,\n",
       " 357604,\n",
       " 358801,\n",
       " 360000,\n",
       " 361201,\n",
       " 362404,\n",
       " 363609,\n",
       " 364816,\n",
       " 366025,\n",
       " 367236,\n",
       " 368449,\n",
       " 369664,\n",
       " 370881,\n",
       " 372100,\n",
       " 373321,\n",
       " 374544,\n",
       " 375769,\n",
       " 376996,\n",
       " 378225,\n",
       " 379456,\n",
       " 380689,\n",
       " 381924,\n",
       " 383161,\n",
       " 384400,\n",
       " 385641,\n",
       " 386884,\n",
       " 388129,\n",
       " 389376,\n",
       " 390625,\n",
       " 391876,\n",
       " 393129,\n",
       " 394384,\n",
       " 395641,\n",
       " 396900,\n",
       " 398161,\n",
       " 399424,\n",
       " 400689,\n",
       " 401956,\n",
       " 403225,\n",
       " 404496,\n",
       " 405769,\n",
       " 407044,\n",
       " 408321,\n",
       " 409600,\n",
       " 410881,\n",
       " 412164,\n",
       " 413449,\n",
       " 414736,\n",
       " 416025,\n",
       " 417316,\n",
       " 418609,\n",
       " 419904,\n",
       " 421201,\n",
       " 422500,\n",
       " 423801,\n",
       " 425104,\n",
       " 426409,\n",
       " 427716,\n",
       " 429025,\n",
       " 430336,\n",
       " 431649,\n",
       " 432964,\n",
       " 434281,\n",
       " 435600,\n",
       " 436921,\n",
       " 438244,\n",
       " 439569,\n",
       " 440896,\n",
       " 442225,\n",
       " 443556,\n",
       " 444889,\n",
       " 446224,\n",
       " 447561,\n",
       " 448900,\n",
       " 450241,\n",
       " 451584,\n",
       " 452929,\n",
       " 454276,\n",
       " 455625,\n",
       " 456976,\n",
       " 458329,\n",
       " 459684,\n",
       " 461041,\n",
       " 462400,\n",
       " 463761,\n",
       " 465124,\n",
       " 466489,\n",
       " 467856,\n",
       " 469225,\n",
       " 470596,\n",
       " 471969,\n",
       " 473344,\n",
       " 474721,\n",
       " 476100,\n",
       " 477481,\n",
       " 478864,\n",
       " 480249,\n",
       " 481636,\n",
       " 483025,\n",
       " 484416,\n",
       " 485809,\n",
       " 487204,\n",
       " 488601,\n",
       " 490000,\n",
       " 491401,\n",
       " 492804,\n",
       " 494209,\n",
       " 495616,\n",
       " 497025,\n",
       " 498436,\n",
       " 499849,\n",
       " 501264,\n",
       " 502681,\n",
       " 504100,\n",
       " 505521,\n",
       " 506944,\n",
       " 508369,\n",
       " 509796,\n",
       " 511225,\n",
       " 512656,\n",
       " 514089,\n",
       " 515524,\n",
       " 516961,\n",
       " 518400,\n",
       " 519841,\n",
       " 521284,\n",
       " 522729,\n",
       " 524176,\n",
       " 525625,\n",
       " 527076,\n",
       " 528529,\n",
       " 529984,\n",
       " 531441,\n",
       " 532900,\n",
       " 534361,\n",
       " 535824,\n",
       " 537289,\n",
       " 538756,\n",
       " 540225,\n",
       " 541696,\n",
       " 543169,\n",
       " 544644,\n",
       " 546121,\n",
       " 547600,\n",
       " 549081,\n",
       " 550564,\n",
       " 552049,\n",
       " 553536,\n",
       " 555025,\n",
       " 556516,\n",
       " 558009,\n",
       " 559504,\n",
       " 561001,\n",
       " 562500,\n",
       " 564001,\n",
       " 565504,\n",
       " 567009,\n",
       " 568516,\n",
       " 570025,\n",
       " 571536,\n",
       " 573049,\n",
       " 574564,\n",
       " 576081,\n",
       " 577600,\n",
       " 579121,\n",
       " 580644,\n",
       " 582169,\n",
       " 583696,\n",
       " 585225,\n",
       " 586756,\n",
       " 588289,\n",
       " 589824,\n",
       " 591361,\n",
       " 592900,\n",
       " 594441,\n",
       " 595984,\n",
       " 597529,\n",
       " 599076,\n",
       " 600625,\n",
       " 602176,\n",
       " 603729,\n",
       " 605284,\n",
       " 606841,\n",
       " 608400,\n",
       " 609961,\n",
       " 611524,\n",
       " 613089,\n",
       " 614656,\n",
       " 616225,\n",
       " 617796,\n",
       " 619369,\n",
       " 620944,\n",
       " 622521,\n",
       " 624100,\n",
       " 625681,\n",
       " 627264,\n",
       " 628849,\n",
       " 630436,\n",
       " 632025,\n",
       " 633616,\n",
       " 635209,\n",
       " 636804,\n",
       " 638401,\n",
       " 640000,\n",
       " 641601,\n",
       " 643204,\n",
       " 644809,\n",
       " 646416,\n",
       " 648025,\n",
       " 649636,\n",
       " 651249,\n",
       " 652864,\n",
       " 654481,\n",
       " 656100,\n",
       " 657721,\n",
       " 659344,\n",
       " 660969,\n",
       " 662596,\n",
       " 664225,\n",
       " 665856,\n",
       " 667489,\n",
       " 669124,\n",
       " 670761,\n",
       " 672400,\n",
       " 674041,\n",
       " 675684,\n",
       " 677329,\n",
       " 678976,\n",
       " 680625,\n",
       " 682276,\n",
       " 683929,\n",
       " 685584,\n",
       " 687241,\n",
       " 688900,\n",
       " 690561,\n",
       " 692224,\n",
       " 693889,\n",
       " 695556,\n",
       " 697225,\n",
       " 698896,\n",
       " 700569,\n",
       " 702244,\n",
       " 703921,\n",
       " 705600,\n",
       " 707281,\n",
       " 708964,\n",
       " 710649,\n",
       " 712336,\n",
       " 714025,\n",
       " 715716,\n",
       " 717409,\n",
       " 719104,\n",
       " 720801,\n",
       " 722500,\n",
       " 724201,\n",
       " 725904,\n",
       " 727609,\n",
       " 729316,\n",
       " 731025,\n",
       " 732736,\n",
       " 734449,\n",
       " 736164,\n",
       " 737881,\n",
       " 739600,\n",
       " 741321,\n",
       " 743044,\n",
       " 744769,\n",
       " 746496,\n",
       " 748225,\n",
       " 749956,\n",
       " 751689,\n",
       " 753424,\n",
       " 755161,\n",
       " 756900,\n",
       " 758641,\n",
       " 760384,\n",
       " 762129,\n",
       " 763876,\n",
       " 765625,\n",
       " 767376,\n",
       " 769129,\n",
       " 770884,\n",
       " 772641,\n",
       " 774400,\n",
       " 776161,\n",
       " 777924,\n",
       " 779689,\n",
       " 781456,\n",
       " 783225,\n",
       " 784996,\n",
       " 786769,\n",
       " 788544,\n",
       " 790321,\n",
       " 792100,\n",
       " 793881,\n",
       " 795664,\n",
       " 797449,\n",
       " 799236,\n",
       " 801025,\n",
       " 802816,\n",
       " 804609,\n",
       " 806404,\n",
       " 808201,\n",
       " 810000,\n",
       " 811801,\n",
       " 813604,\n",
       " 815409,\n",
       " 817216,\n",
       " 819025,\n",
       " 820836,\n",
       " 822649,\n",
       " 824464,\n",
       " 826281,\n",
       " 828100,\n",
       " 829921,\n",
       " 831744,\n",
       " 833569,\n",
       " 835396,\n",
       " 837225,\n",
       " 839056,\n",
       " 840889,\n",
       " 842724,\n",
       " 844561,\n",
       " 846400,\n",
       " 848241,\n",
       " 850084,\n",
       " 851929,\n",
       " 853776,\n",
       " 855625,\n",
       " 857476,\n",
       " 859329,\n",
       " 861184,\n",
       " 863041,\n",
       " 864900,\n",
       " 866761,\n",
       " 868624,\n",
       " 870489,\n",
       " 872356,\n",
       " 874225,\n",
       " 876096,\n",
       " 877969,\n",
       " 879844,\n",
       " 881721,\n",
       " 883600,\n",
       " 885481,\n",
       " 887364,\n",
       " 889249,\n",
       " 891136,\n",
       " 893025,\n",
       " 894916,\n",
       " 896809,\n",
       " 898704,\n",
       " 900601,\n",
       " 902500,\n",
       " 904401,\n",
       " 906304,\n",
       " 908209,\n",
       " 910116,\n",
       " 912025,\n",
       " 913936,\n",
       " 915849,\n",
       " 917764,\n",
       " 919681,\n",
       " 921600,\n",
       " 923521,\n",
       " 925444,\n",
       " 927369,\n",
       " 929296,\n",
       " 931225,\n",
       " 933156,\n",
       " 935089,\n",
       " 937024,\n",
       " 938961,\n",
       " 940900,\n",
       " 942841,\n",
       " 944784,\n",
       " 946729,\n",
       " 948676,\n",
       " 950625,\n",
       " 952576,\n",
       " 954529,\n",
       " 956484,\n",
       " 958441,\n",
       " 960400,\n",
       " 962361,\n",
       " 964324,\n",
       " 966289,\n",
       " 968256,\n",
       " 970225,\n",
       " 972196,\n",
       " 974169,\n",
       " 976144,\n",
       " 978121,\n",
       " 980100,\n",
       " 982081,\n",
       " 984064,\n",
       " 986049,\n",
       " 988036,\n",
       " 990025,\n",
       " 992016,\n",
       " 994009,\n",
       " 996004,\n",
       " 998001]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%time [i**2 for i in range(1000)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "704 µs ± 9.93 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "import random \n",
    "li = [random.random() for i in range(100000)]\n",
    "%timeit li.sort()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## %%html"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div class=\"style\">html content</div>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%html\n",
    "<div class=\"style\">html content</div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/javascript": [
       "document.querySelector('.style').innerHTML=\"content changed\"\n"
      ],
      "text/plain": [
       "<IPython.core.display.Javascript object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%js\n",
    "document.querySelector('.style').innerHTML=\"content changed\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing write.py\n"
     ]
    }
   ],
   "source": [
    "%%writefile write.py\n",
    "print('hhhh')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# %load write.py\n",
    "print('hhhh')\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
